<?php

require 'vendor/autoload.php';

spl_autoload_register(
    function ($class) {
        if (FALSE !== $pos = strrpos($class, '\\')) {
            // namespaced class name
            $classPath = str_replace(
                '\\', DIRECTORY_SEPARATOR,
                substr($class, 0, $pos)
            ) . DIRECTORY_SEPARATOR;
            $className = substr($class, $pos + 1);

            $path = 'app/Classes/' . $classPath . $className . '.php';
            if (file_exists($path)) {
                require $path;
            }
        }
    }
);